package com.example.demox.controller;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class ConfUtil {

    public static Properties p = null;

    /**
     * @param configFilePath
     * @param str
     * @return
     */
    public static String getConfig(String configFilePath, String str) {
        if(p == null){
            p = new Properties();
        }
        try {
            p.load(new BufferedInputStream(new FileInputStream(configFilePath)));
            return p.getProperty(str).trim();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }


}
